package com.example.tianyidemo.controller;
import com.example.tianyidemo.pojo.Result;
import com.example.tianyidemo.pojo.Section;
import com.example.tianyidemo.service.SectionAndCircleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
//获取版块和圈子信息
@Slf4j
@CrossOrigin//准许跨域请求
@RestController//包含@Controller（三层架构声明控制器）和@ResponseBody（转化json格式）
public class SectionAndCircleController {
    @Autowired
    private SectionAndCircleService sectionAndCircleService;
    @ResponseBody
    @GetMapping("/getsectionAndCircle")
    public Result sectionAndCircleListlist(){
        List<Section> sectionAndCircleList = sectionAndCircleService.getSAC();
        return Result.success(sectionAndCircleList);
    };
}
